<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Banners_Model extends CI_Model{
    function __construct()
    {
        parent::__construct();
    }
    function getAllData($num,$offset){
        $query = $this->db->get('banners',$num,$offset);
      
        return $query->result();  
    } 
     function get_object($id)
    {
        $query = $this->db->get_where('banners', array('banners_id' =>$id));
        return $query->row();
    }
    
    function get_from_group($group_id=0)
    {	  
		   $this->db->select('banners.*');
		    $this->db->where('banners.group_id',$group_id);
            $this->db->where('banners.bl_active',1);
			$this->db->order_by('nb_order','ASC');
            $query = $this->db->get('banners');
            return $query->result();
    }
    
  }
?>
